#include "HalfStar.h"
#include "QList"
#include "QPointer"
#include "math.h"
#include "QDebug"

HalfStar::HalfStar()
{
}

QList<Candidate* > HalfStar::select(QList<Candidate* > population, int selectionSize) {
    QList<QList<Candidate* > > twoDimCandidates;
    int x = 0;
    int y = 0;
    int remainder = 0;
    x = round(sqrt(population.size()));
    y = floor0(population.size()/x);
    remainder = population.size() - (x*y);
    //Tournament
    for(int i=0; i<(population.size() - remainder);i++) {

    }
}

int HalfStar::round( double value ){
    return (int) floor( value + 0.5 );
}
int HalfStar::floor0( double value )
  {
  if (value < 0.0)
    return (int) ceil( value );
  else
    return (int) floor( value );
  }
